package com.rickpan.dto.request;

import com.rickpan.entity.WorkRecord;
import jakarta.validation.constraints.*;

import java.time.LocalDate;
import java.util.List;

/**
 * 更新工作记录请求DTO
 */
public class UpdateWorkRecordRequest {

    private LocalDate date;

    @Size(max = 200, message = "工作标题长度不能超过200个字符")
    private String title;

    @Size(max = 5000, message = "工作内容长度不能超过5000个字符")
    private String content;

    private Long categoryId;

    private WorkRecord.Status status;

    private WorkRecord.Priority priority;

    @Min(value = 0, message = "工作时间不能为负数")
    @Max(value = 1440, message = "单日工作时间不能超过1440分钟")
    private Integer timeSpent;

    private List<String> tags;

    // 构造函数
    public UpdateWorkRecordRequest() {}

    // Getter 和 Setter 方法
    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public WorkRecord.Status getStatus() {
        return status;
    }

    public void setStatus(WorkRecord.Status status) {
        this.status = status;
    }

    public WorkRecord.Priority getPriority() {
        return priority;
    }

    public void setPriority(WorkRecord.Priority priority) {
        this.priority = priority;
    }

    public Integer getTimeSpent() {
        return timeSpent;
    }

    public void setTimeSpent(Integer timeSpent) {
        this.timeSpent = timeSpent;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    @Override
    public String toString() {
        return "UpdateWorkRecordRequest{" +
                "date=" + date +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", categoryId=" + categoryId +
                ", status=" + status +
                ", priority=" + priority +
                ", timeSpent=" + timeSpent +
                ", tags=" + tags +
                '}';
    }
}
